package com.example.icedcap.topeka_fake.helper;

import android.os.Parcel;

/**
 * Author: doushuqi
 * Date: 15/7/13
 * Time: 下午3:34
 * Email: shuqi.dou@singuloid.com
 */
public class ParcelableHelper {
    public ParcelableHelper() {
        //no instance
    }

    public static void writeBoolean(Parcel dest, boolean toWrite){
        dest.writeInt(toWrite? 0 : 1);
    }

    public static boolean readBoolean(Parcel in) {
        return 0 == in.readInt();
    }

    public static void writeEnumValue(Parcel dest, Enum e) {
        dest.writeInt(e.ordinal());
    }
}
